numactl
CPUAffinity
, NUMAPolicy
, NUMAMask
# Example: Start PostgreSQL bound to NUMA node 0
numactl --cpunodebind=0 --membind=0 -- pg_ctl start
# Example: Start PostgreSQL with balancing NUMA node usage on all nodes
numactl --interleave=all -- pg_ctl start
-- Identifying buffer distribution across NUMA nodes
select page_num,node_id,count(*)
from pg_buffercache_numa
group by page_num,node_id
order by 1
limit 3;
page_num | node_id | count
----------+---------+-------
0 | 1 | 1024
1 | 0 | 1024
2 | 1 | 1024
Multi-threaded programming model would be superior
Robert Haas, hackers mailing-list, 2024-06-05
Access Times (log scale)
L1 Cache ββ β 1ns (4 cycles)
L2 Cache βββββ β 4ns (12 cycles)
L3 Cache βββββββββββββ β 12ns (40 cycles)
RAM βββββββββββββββββββββββββββββββββββββ β 100ns (300 cycles)
NVMe SSD ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 20,000ns (60K cycles)
SATA SSD ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 100,000ns (300K cycles)
Thank You!
Bluesky: @l-avrot.bsky.social
Linkedin: lætitia-avrot